package com.chenjinyan.user.utils;

import lombok.Data;

/**
 * @author chenjinyan
 * @version 1.0
 */
@Data
public class DescribeException extends RuntimeException {

    private String code;

    /**
     * 继承exception，加入错误状态值
     *
     * @param exceptionEnum
     */
    public DescribeException(ExceptionEnum exceptionEnum) {
        super(exceptionEnum.getMsg());
        this.code = exceptionEnum.getCode();
    }

    /**
     * 自定义错误信息
     *
     * @param message
     * @param code
     */
    public DescribeException(String message, String code) {
        super(message);
        this.code = code;
    }


}
